<?php
echo 'reset start...', "\n";
$root = dirname(dirname(__FILE__));

echo "reset index.json\n";
file_put_contents($root . '/data/index.json', '[]');

echo "rm posts data\n";
exec('rm -f ' . $root . '/data/posts/*.json');

echo "rm posts html\n";
exec('rm -f ' . $root . '/post/*.html');

echo "rm index*.html\n";
exec('rm -f ' . $root . '/index*.html');

echo "reset category ...\n";
file_put_contents($root . '/data/categorys.json', '[{"name":"\u672a\u5206\u7c7b","posts":[]}]');

echo "reset tag ...\n";
file_put_contents($root . '/data/tags.json', '{}');

echo "reset nav ...\n";
file_put_contents($root . '/data/navs.json', json_encode(array()));
